import { Injectable, Inject } from '@angular/core';
import { HttpClient, HttpHeaders } from '@angular/common/http';

import { Observable } from 'rxjs/Observable';

// import { User } from '../models/index';
// import { Header } from 'primeng/primeng';

@Injectable()
export class DataService {

  //  url1 = "http://203.81.246.122:8080/api/security/login";
  

  constructor(private http: HttpClient, @Inject('API_URL') private url: string) { }

 
  getTree(): Observable<any> {
    const url = `${this.url}system/target/group/type/tree`;
    const headers = new HttpHeaders()
      .set('Content-Type', 'application/x-www-form-urlencoded');
    
    return this.http
      .get(url, { headers: headers })
  }

}
